/*
 *company:jlc
 *author:xudd
 *date:2020/5/14:11:15
 *desc:{}
 **/


package com.crazymakercircle.redis.sentinel;

import redis.clients.jedis.JedisSentinelPool;

import java.util.HashSet;
import java.util.Set;

/**
 * @author:xudd
 * @date:2020/5/14 -11:15
 * @desc: 哨兵机制用法
 **/
public class JedisSentinelUtils {
    private static final String MASTER_NAME="mymaster";

    private static JedisSentinelPool sentinelPool;

     static{
        Set<String> sentinelSet = new HashSet<>();
        sentinelSet.add("182.254.175.84:26379");
         sentinelSet.add("203.195.130.237:26379");
         sentinelSet.add("203.195.134.101:26379");

         sentinelPool= new JedisSentinelPool(MASTER_NAME,sentinelSet);

     }

     /**
      * @author: xudd
      * @desc: //TODO
      * @date: 11:24 2020/5/14
      * @param:
      * @return: 获取哨兵连接池
      **/
  public static JedisSentinelPool getSentinelPool(){


     return  sentinelPool;

  }







}
